package com.bird.user.remote

import com.bird.user.application.UserQueryService
import com.bird.user.client.UserClient
import com.bird.user.client.pl.UserInfoClientRes
import jakarta.annotation.Resource
import org.springframework.stereotype.Component

@Component
class UserClientImpl :UserClient {

    @Resource
    lateinit var userQueryService: UserQueryService

    /**
     * 获取用户信息
     */
    override fun oneUser(userId: Long): UserInfoClientRes? {
        return userQueryService.oneUser(userId)?.toUserClientRes()
    }
    /**
     * 获取用户信息
     */
    override fun oneUser(username: String, password: String): UserInfoClientRes? {
        return userQueryService.oneUser(username, password)?.toUserClientRes()
    }
}